home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 1951 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: gryphon.phoenix.net!usenet
  2. From: brucew@phoenix.net (Bruce Wedding)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: What the hell is THIS?!
  5. Date: Thu, 18 Jan 1996 01:06:49 GMT
  6. Organization: BranPaul Systems
  7. Message-ID: <4dk45c$pdp@gryphon.phoenix.net>
  8. References: <4d6rgh$rfu@abel.cc.sunysb.edu> <coc-1301960253420001@dal1498.computek.net> <821539645snz@genesis.demon.co.uk>
  9. NNTP-Posting-Host: dial68.phoenix.net
  10. X-Newsreader: Moe's Newsreader    
  11.  
  12. Lawrence Kirby <fred@genesis.demon.co.uk> wrote:
  13.  
  14. >No, it is a pointer to an array of 3 ints.
  15.  
  16. Hi Lawrence,
  17.  
  18. I knew what it was, because I read AND understood that part of Deep C
  19. Secrets.  What I don't understand is where one would need something
  20. like this.  I can certainly use a pointer to an int array, but why
  21. specifically an array of 3?  I don't think this buys you anything
  22. really.  The three doesn't magically terminate the array like a nul.
  23. It doesn't allocate any memory.  So why and where and what is wrong
  24. with just allocating it, if that is what you need?
  25.  
  26. p = malloc(3 * sizeof(int));
  27.  
  28.  
  29. Bruce D. Wedding                        Have Compiler, Will Travel!
  30.               Perspicacious Programming Performed Promptly
  31. Katy, Texas, USA, Planet Earth, Milkyway Galaxy, Known Universe
  32.  
  33.